21 #ifdef UD_NQ_CODEPAGEUTF8
32 #define SY_OSNAME "RedHat Linux"
34 #define syAssert(_stat_) assert(_stat_)
47 #define syGetTimeInSec() time(0)
53 NQ_TIME syGetTimeInMsec(void);
105 #define sySleep(_secs_) sleep(_secs_)
106 #define syUSleep(_msecs_) usleep(_msecs_)
108 #if defined(CM_NQ_STORAGE) || defined(DOXYGEN)
139 #define SYThread pthread_t
140 #define syIsValidThread(_taskId_) TRUE
142 #define syThreadGetCurrent pthread_self
154 #define syThreadDestroy(_taskId_) pthread_cancel(_taskId_);
165 #define SYMutex pthread_mutex_t
169 pthread_mutex_t mutex;
182 #if defined(MUTEX_DEBUG) || defined(DOXYGEN)
196 #define syMutexTake(_m) syMutexTakeDebug(_m, SY_LOG_FILE, SY_LOG_LINE)
205 #define syMutexDelete(_m) pthread_mutex_destroy(_m)
206 #define syMutexTake(_m) pthread_mutex_lock(_m)
207 #define syMutexGive(_m) pthread_mutex_unlock(_m)
223 #define SY_SEMAPHORE_AVAILABLE
225 #if defined(SY_SEMAPHORE_AVAILABLE) || defined(DOXYGEN)
227 #define SYSemaphore sem_t
250 #define sySemaphoreDelete(_s) sem_destroy(&_s)
251 #define sySemaphoreTake(_s) sem_wait(&_s)
252 #define sySemaphoreGive(_s) sem_post(&_s)
270 #if defined(UD_NQ_USETRANSPORTIPV6) || defined(DOXYGEN)
272 #ifdef SY_LITTLEENDIANHOST
273 #define SY_LOCALHOSTIP4 {0x007f, 0x0100}
274 #define SY_LOCALHOSTIP6 {0, 0, 0, 0, 0, 0, 0, 0x0100}
275 #define SY_LINKLOCALIP 0x80fe
277 #define SY_LOCALHOSTIP4 {0x7f00 , 0x0001}
278 #define SY_LOCALHOSTIP6 {0, 0, 0, 0, 0, 0, 0, 1}
279 #define SY_LINKLOCALIP 0xfe80
281 #define SY_ANYIP4 {0, 0}
282 #define SY_ANYIP6 {0, 0, 0, 0, 0, 0, 0, 0}
283 #define SY_ZEROIP {0, 0, 0, 0, 0, 0, 0, 0}
287 #ifdef SY_LITTLEENDIANHOST
288 #define SY_LOCALHOSTIP 0x0100007f
290 #define SY_LOCALHOSTIP 0x7f000001
297 #define SY_ZEROIP4 0L
299 #if defined(UD_NQ_USETRANSPORTIPV6) || defined(DOXYGEN)
328 #define SY_INTERNALSOCKETPOOL
329 #undef SY_INTERNALSOCKETPOOL
331 #define SYSocketHandle NQ_INT
332 #define SYSocketSet fd_set
333 #define syIsValidSocket(_sock) (_sock != ERROR)
345 #define syInvalidSocket() (ERROR)
346 #define syAddSocketToSet(_sock, _set) FD_SET((_sock), (_set))
347 #define syIsSocketSet(_sock, _set) FD_ISSET((_sock), (_set))
348 #define syClearSocketSet(_set) FD_ZERO((_set))
355 #define syClearSocketFromSet(_sock, _set) FD_CLR((_sock), (_set))
508 void (*releaseFunc)(
const NQ_BYTE*)
580 #define sySetDatagramSocketOptions(_sock)
581 #define sySetStreamSocketOptions(_sock)
626 #define syGetPid() getpid()
640 #define SYDirectory DIR*
641 #define syInvalidateDirectory(_pd) *(_pd) = NULL
642 #define syIsValidDirectory(_d) (_d != NULL)
722 #define SY_EXTENDFILENOTSUPPORTED
723 #undef SY_EXTENDFILENOTSUPPORTED
725 #define SY_PATHSEPARATOR '/'
728 #define syInvalidateFile(_f) *_f = ERROR
729 #define syIsValidFile(_file) (_file!=ERROR)
730 #define syInvalidFile() (ERROR)
733 #define SY_CP_FIRSTILLEGALCHAR {0xe5}
734 #define SY_CP_ANYILLEGALCHAR {0x7c, 0x5c}
837 #define syFlushFile(_file) ((fsync(_file)==OK)? NQ_SUCCESS:NQ_FAIL)
983 #define syGetSecurityDescriptor(_f, _i, _b) udGetSecurityDescriptor(_f, _i, _b)
984 #define sySetSecurityDescriptor(_f, _i, _b, _l) udSetSecurityDescriptor(_f, _i, _b, _l)
992 #define syPrintf printf
993 #define syFprintf fprintf
994 #define sySprintf sprintf
995 #define sySnprintf snprintf
996 #define syVsnprintf vsnprintf
997 #define sySscanf sscanf
998 #define syScanf scanf
999 #define syGetchar getchar
1000 #define syFflush fflush
1015 #define syUnlockFile( \
1022 ) ((_file==ERROR)? NQ_FAIL:NQ_SUCCESS)
1023 #define syLockFile( \
1031 ) ((_file==ERROR)? NQ_FAIL:NQ_SUCCESS)
1044 #define syGetHostName(_name, _nameLen) gethostname((_name), (_nameLen))
1056 #if defined(UD_NQ_USETRANSPORTIPV4) || defined(UD_NQ_USETRANSPORTIPV6) || defined(DOXYGEN)
1106 #if defined(UD_CS_INCLUDEDIRECTTRANSFER) || defined(DOXYGEN)
1169 #define SY_UNICODEFILESYSTEM
1170 #undef SY_UNICODEFILESYSTEM
1172 #if defined(UD_CC_INCLUDELDAP) || defined(UD_NQ_CODEPAGEUTF8) || defined(DOXYGEN)
1208 #if defined(UD_NQ_CODEPAGEUTF8) || defined(DOXYGEN)
1222 #define sySetRand() srand((unsigned int)time(0))
1223 #define syRand() rand()
NQ_STATUS syGetFileInformation(SYFile file, const NQ_WCHAR *fileName, SYFileInformation *fileInfo)
NQ_UINT32 sySeekFileCurrent(SYFile file, NQ_INT32 off, NQ_INT32 offHigh)
NQ_UINT NQ_INDEX
Definition: udapi.h:31
long NQ_INT32
Definition: udapi.h:37
NQ_UINT16 NQ_IPADDRESS6[8]
Definition: udapi.h:50
NQ_STATUS syDeleteFile(const NQ_WCHAR *name)
NQ_STATUS syGetVolumeInformation(const NQ_WCHAR *name, SYVolumeInformation *info)
NQ_STATUS sySendMulticast(SYSocketHandle socket, const NQ_BYTE *buffer, NQ_COUNT length, const NQ_IPADDRESS *ip, NQ_PORT port)
NQ_BOOL syGmtToString(NQ_BYTE *strTime, NQ_COUNT size, NQ_UINT32 t, const NQ_CHAR *fmt)
void syDtEndPacket(SYSocketHandle sock)
unsigned int NQ_UINT
Definition: udapi.h:29
void sySemaphoreResetCounter(SYSemaphore *pSemID)
NQ_UINT32 syConvertTimeInMsecToSec(NQ_TIME *timeMsec)
NQ_STATUS sySendSocketAsync(SYSocketHandle sock, const NQ_BYTE *buf, NQ_COUNT len, void(*releaseFunc)(const NQ_BYTE *))
void syMutexGive(SYMutex *_m)
NQ_STATUS sySetFileInformation(const NQ_WCHAR *fileName, SYFile handle, const SYFileInformation *fileInfo)
#define SYMutex
Definition: syopsyst.h:165
NQ_STATUS syCreateDirectory(const NQ_WCHAR *name)
NQ_STATUS syShutdownSocket(SYSocketHandle sock)
NQ_INT syReadFile(SYFile file, NQ_BYTE *buf, NQ_COUNT len)
SYFile syOpenFileForRead(const NQ_WCHAR *name, NQ_BOOL denyread, NQ_BOOL denyexecute, NQ_BOOL denywrite)
NQ_INT sySemaphoreTimedTake(SYSemaphore *sem, NQ_INT timeout)
NQ_STATUS syGetFileSize(SYFile file, NQ_UINT64 *size)
NQ_STATUS syRenameFile(const NQ_WCHAR *oldName, const NQ_WCHAR *newName)
NQ_STATUS syListenSocket(SYSocketHandle sock, NQ_INT backlog)
NQ_INT sySelectSocket(SYSocketSet *pset, NQ_UINT32 timeout)
NQ_UINT32 NQ_IPADDRESS4
Definition: udapi.h:49
NQ_INT syRecvSocket(SYSocketHandle sock, NQ_BYTE *buf, NQ_COUNT len)
NQ_BOOL initCodePageUTF8(void)
void sySetClientSocketOptions(SYSocketHandle sock)
NQ_STATUS syDtStartPacket(SYSocketHandle sock)
void syUTF8ToUnicodeN(NQ_WCHAR *outWStr, NQ_UINT outLength, const NQ_CHAR *inStr, NQ_UINT inLength)
#define SYSocketHandle
Definition: syopsyst.h:331
SYFile syOpenFileForWrite(const NQ_WCHAR *name, NQ_BOOL denyread, NQ_BOOL denyexecute, NQ_BOOL denywrite)
NQ_STATUS syConnectSocket(SYSocketHandle sock, const NQ_IPADDRESS *ip, NQ_PORT port)
Definition: sycommon.h:125
void syUnicodeToUTF8N(NQ_CHAR *outStr, NQ_UINT outLength, const NQ_WCHAR *inWStr, NQ_UINT inLength)
void syMutexCreate(SYMutex *_m)
NQ_INT syRecvSocketWithTimeout(SYSocketHandle sock, NQ_BYTE *buf, unsigned int len, unsigned int secs)
NQ_UINT32 syGetIPv6ScopeId(const NQ_IPADDRESS6 ip)
NQ_UINT16 NQ_PORT
Definition: udapi.h:48
NQ_BOOL syIsSocketAlive(SYSocketHandle sock)
NQ_STATUS syDtToSocket(SYSocketHandle sock, SYFile file, NQ_COUNT *len)
#define SYSocketSet
Definition: syopsyst.h:332
SYFile syOpenFileForReadWrite(const NQ_WCHAR *name, NQ_BOOL denyread, NQ_BOOL denyexecute, NQ_BOOL denywrite)
NQ_UINT NQ_COUNT
Definition: udapi.h:32
NQ_UINT16 NQ_WCHAR
Definition: udapi.h:45
NQ_UINT32 sySeekFileStart(SYFile file, NQ_UINT32 off, NQ_UINT32 offHigh)
NQ_UINT32 syComposeTime(const SYTimeFragments *decomposed)
void syGetDnsParams(NQ_CHAR *domain, NQ_IPADDRESS *server)
NQ_STATUS syCloseFile(SYFile fd)
SYSocketHandle syCreateSocket(NQ_BOOL stream, NQ_UINT family)
#define SYFile
Definition: syopsyst.h:727
#define SYSemaphore
Definition: syopsyst.h:227
unsigned char NQ_BYTE
Definition: udapi.h:27
NQ_STATUS syFirstDirectoryFile(const NQ_WCHAR *name, SYDirectory *pDir, const NQ_WCHAR **fileName)
void syDecomposeTime(NQ_UINT32 time, SYTimeFragments *decomposed)
NQ_INT syWriteFile(SYFile file, const NQ_BYTE *buf, NQ_COUNT len)
NQ_UINT32 syGetLastSmbError(void)
void syGetSocketPortAndIP(SYSocketHandle sock, NQ_IPADDRESS *ip, NQ_PORT *port)
void sySetLastNqError(NQ_STATUS nqErr)
NQ_STATUS syGetAdapter(NQ_INDEX adapterIdx, NQ_INDEX *osIndex, NQ_IPADDRESS4 *pIp, NQ_IPADDRESS6 *ip6, NQ_IPADDRESS4 *pSubnet, NQ_IPADDRESS4 *pBcast, NQ_WCHAR *pWins, NQ_WCHAR *pDns)
void syMutexDelete(SYMutex *_m)
NQ_TIME syConvertTimeSpecToTimeInMsec(void *val)
int NQ_INT
Definition: udapi.h:28
NQ_INT sySendToSocket(SYSocketHandle sock, const NQ_BYTE *buf, NQ_COUNT len, const NQ_IPADDRESS *ip, NQ_PORT port)
NQ_STATUS syAllowBroadcastsSocket(SYSocketHandle sock)
int syUnixMode2DosAttr(int mode)
NQ_STATUS syCloseSocket(SYSocketHandle sock)
NQ_STATUS syGetFileInformationByName(const NQ_WCHAR *fileName, SYFileInformation *fileInfo)
void syGetMacAddress(NQ_IPADDRESS4 ip, NQ_BYTE *macBuffer)
SYSocketHandle syAcceptSocket(SYSocketHandle sock, NQ_IPADDRESS *ip, NQ_PORT *port)
NQ_INT syGetTimeZone(void)
int NQ_BOOL
Definition: udapi.h:30
void sySubscribeToMulticast(SYSocketHandle socket, const NQ_IPADDRESS *ip)
SYDirectory syOpenDirectory(const NQ_WCHAR *name)
void syMutexTakeDebug(SYMutex *_m, const NQ_CHAR *text, const NQ_UINT line)
NQ_STATUS syTruncateFile(SYFile file, NQ_UINT32 offLow, NQ_UINT32 offHigh)
NQ_UINT32 sySeekFileEnd(SYFile file, NQ_INT32 off, NQ_INT32 offHigh)
NQ_STATUS syBindSocket(SYSocketHandle sock, const NQ_IPADDRESS *ip, NQ_PORT port, NQ_BOOL reuseAddress)
NQ_STATUS syNextDirectoryFile(SYDirectory dir, const NQ_WCHAR **fileName)
#define SYThread
Definition: syopsyst.h:139
NQ_STATUS syDeleteDirectory(const NQ_WCHAR *name)
char NQ_CHAR
Definition: udapi.h:26
NQ_INT sySendSocket(SYSocketHandle sock, const NQ_BYTE *buf, NQ_COUNT len)
NQ_STATUS sySemaphoreCreate(SYSemaphore *semId, NQ_UINT count)
unsigned long NQ_UINT32
Definition: udapi.h:43
void syThreadStart(NQ_BOOL isRT, NQ_INT priorityLevel, SYThread *taskIdPtr, void(*startpoint)(void), NQ_BOOL background)
NQ_STATUS syDtFromSocket(SYSocketHandle sock, SYFile file, NQ_COUNT *len)
NQ_STATUS syCloseDirectory(SYDirectory dir)
#define SYDirectory
Definition: syopsyst.h:640
NQ_IPADDRESS4 syGetHostByName(const char *name)
SYFile syCreateFile(const NQ_WCHAR *name, NQ_BOOL denyread, NQ_BOOL denyexecute, NQ_BOOL denywrite)
NQ_INT syRecvFromSocket(SYSocketHandle sock, NQ_BYTE *buf, NQ_COUNT len, NQ_IPADDRESS *ip, NQ_PORT *port)
NQ_INT NQ_STATUS
Definition: udapi.h:47